home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1996 November
/
Chip 11-96.iso
/
treiber
/
grafik
/
datapat
/
twinor64
/
nt
/
bholes.mst
< prev
next >
Wrap
Text File
|
1996-04-28
|
8KB
|
336 lines
'**************************************************************************
'* Datapath Black Holes Setup Script
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'msshared.inc'
'************************************************************
'* Functions for reading/writing/checking registration
'* details from the floppy-disk
'************************************************************
DECLARE FUNCTION dll_registered LIB "bhregist.dll" (szDll$) AS INTEGER
DECLARE FUNCTION write_details LIB "bhregist.dll" (szDll$, szUser$, szComp$) AS INTEGER
DECLARE FUNCTION checkstring LIB "bhregist.dll" (szName$) AS INTEGER
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST OPTHELP = 1000
CONST CHECK = 2500
CONST BADPATH = 6400
CONST CDCONFIRMINFO = 7300
CONST CDGETNAMEORG = 7500
CONST CDBADNAME = 7700
CONST CDBADCOMP = 7800
CONST CDWRITEENABLE = 7900
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL WIN_DEST$ ''Default windows directory.
GLOBAL WIN_SYS_DEST$ ''Default windows system directory.
GLOBAL USER_NAME$ ''User name for registration
GLOBAL COMP_NAME$ ''Company name for registration
GLOBAL DLL_NAME$ ''Name of DLL for registration
GLOBAL RETVAL%
GLOBAL CURSORVAL%
'' Return values from dll_registered and write_details
CONST SUCCESS = 0 '' return code for OK
CONST FAILURE = 1 '' return code for not OK
CONST FATAL = 2 '' return code for fatal error
CONST TRUE = 1
CONST FALSE = 0
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "instbh.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Datapath Black Holes 32 Installation"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "BHOLES.INF"
END IF
ReadInfFile szInf$
DEST$ = "C:\BHOLES32"
WIN_DEST$ = GetWindowsDir()
WIN_SYS_DEST$ = GetWindowsSysDir()
SERIAL_NO$ = "000001"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
'/********************************************************************************
MAININSTALL:
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
'***************************************
'**** CD INSTALLATION MODIFICATIONS ****
'***************************************
' User details registration moved here because we cannot modify source dll on
' CD rom !.
'/*******************************************************************************
'/* User details Registration
'/*******************************************************************************
GETREG:
CURSORVAL% = ShowWaitCursor()
USER_NAME$ = ""
COMP_NAME$ = ""
DLL_NAME$ = MAKEPATH(DEST$,"BHOLE32.DLL")
RETVAL% = dll_registered (DLL_NAME$)
RestoreCursor (CURSORVAL%)
IF RETVAL% = SUCCESS THEN
GOTO MAININSTALL
ENDIF
IF RETVAL% = FATAL THEN
ERR = STFERR
GOTO QUIT
ENDIF
GETREGL1:
SetSymbolValue "NameIn", USER_NAME$
SeTSymbolValue "OrgIn", COMP_NAME$
SetSymbolValue "EditFocus", "END"
sz$ = UIStartDlg(CUIDLL$, CDGETNAMEORG, "FNameOrgDlgProc", APPHELP, HELPPROC$)
USER_NAME$ = GetSymbolValue("NameOut")
COMP_NAME$ = GetSymbolValue("OrgOut")
IF sz$ = "CONTINUE" THEN
IF checkstring (USER_NAME$) = FAILURE THEN
GOSUB BADNAME
UIPop 1
GOTO GETREGL1
ENDIF
IF checkstring (COMP_NAME$) = FAILURE THEN
GOSUB BADCOMP
UIPop 1
GOTO GETREGL1
ENDIF
UIPop 1
SetSymbolValue "ConfirmTextIn", USER_NAME$
AddListItem "ConfirmTextIn", COMP_NAME$
sz$ = UIStartDlg (CUIDLL$, CDCONFIRMINFO, "FConfirmDlgProc", APPHELP, HELPPROC$)
UIPop 1
IF sz$ = "BACK" THEN
GOTO GETREGL1
ENDIF
WRITELOOP:
CURSORVAL% = ShowWaitCursor()
RETVAL% = write_details (DLL_NAME$, USER_NAME$, COMP_NAME$)
RestoreCursor (CURSORVAL%)
IF RETVAL <> SUCCESS THEN
GOSUB BADWRITE
GOTO WRITELOOP
ENDIF
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETREGL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETREG
END IF
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
BADNAME:
sz$ = UIStartDlg(CUIDLL$, CDBADNAME, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADNAME
END IF
UIPop 1
RETURN
BADCOMP:
sz$ = UIStartDlg(CUIDLL$, CDBADCOMP, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADCOMP
END IF
UIPop 1
RETURN
BADWRITE:
sz$ = UIStartDlg(CUIDLL$, CDWRITEENABLE, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSE
UIPop 1
END IF
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
CreateDir DEST$, cmoNone
'******* CreateDir DEST$ + "\EFFECTS", cmoNone
SrcDir$ = GetSymbolValue("STF_SRCDIR")
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
'******* AddSectionFilesToCopyList "effects", SrcDir$, DEST$ + "\EFFECTS"
CopyFilesInCopyList
szGroup$ = "DATAPATH"
szPath$ = ""
CreateProgmanGroup szGroup$,szPath$,cmoNone
szItem$ = "Black Holes 32"
szCmd$ = MAKEPATH(DEST$,"BHOLES32.EXE")
szOther$ = ""
CreateProgmanItem szGroup$,szItem$,szCmd$,szOther,cmoOverwrite
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION